package com.jiaai.web.zfp_back.terms;

import com.alibaba.dubbo.config.annotation.Reference;
import com.jiaai.terms.api.InTermsApi;
import com.jiaai.terms.model.InTerms;
import com.jiaai.util.RestResultGenerator;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/admin/terms")
public class ZBTermsController {

    @Reference
    private InTermsApi inTermsApi;

    @PostMapping("/insertOrUpdateTerms")
    public Object insertOrUpdateTerms(@RequestBody InTerms inTerms){
        return inTermsApi.insertOrUpdateTerms(inTerms);
    }
    @GetMapping("/seachTerms")
    public Object seachTerms(){
        try {
            return RestResultGenerator.genSuccessResult(inTermsApi.seachTerms());
        }catch (Exception e){
            return RestResultGenerator.genErrorResult("");
        }
    }

}
